// Copyright 2010 Google Inc. All Rights Reserved.

package MAMDA.main;

import java.io.IOException;
import java.util.*;
import MAMDA.MAMDA;
import random.Launcher;
import util.GAConfig;
import util.GAOperationsConfig;
/**
 * The entry class for test generation.
 * 
 *
 */
public class OfflineMain {

 
  //the file
   public static void main(String[] args) throws IOException, ClassNotFoundException {
    
        //only for experiment
        System.out.println("In experiment environment ....");
        List<String> class_txt_file=getExperiment_ListClasses();
        List<Integer> class_maximum_branch=getclass_maximum_branch();

        String[] cut=new String[2];
        for(int algo=0;algo<4;algo+=1){
        	
			GAOperationsConfig.setAlgorithmsToNull();
			
	        for(int i=0;i<class_txt_file.size();i++){

		        	cut[0]=class_txt_file.get(i);
		        	cut[1]=class_maximum_branch.get(i).toString();
		        	switch (algo) {
		        	case 0:
		        		GAConfig.UseReadWrietRelation=true;
		        		GAConfig.useConstantSeeding=true;		        		
		        		MAMDA.main(cut);
		        		break;
		        	case 1:
		        		Launcher.main(cut); break;
		        	case 2:
		        		GAConfig.UseReadWrietRelation=false;
		        		GAConfig.useConstantSeeding=false;		        		
		        		MAMDA.main(cut);
		        		break;
		        	case 3:
		        		GAConfig.UseReadWrietRelation=true;
		        		GAConfig.useConstantSeeding=false;		        		
		        		MAMDA.main(cut);
		        		break;
		        		
		        	}
		        }
        }
        System.exit(0);
  }
  
  
  public static List<String> getExperiment_ListClasses(){
	  List<String> ListClasses=new LinkedList<String>();
	  
//	  ListClasses.add("C:/MAMDA/MAMDA/roops/CUT.txt");
	  ListClasses.add("c:/MAMDA/jdom.git/CUT.txt");
//	  ListClasses.add("C:/MAMDA/JodaTime/CUT.txt");
//	  ListClasses.add("c:/MAMDA/MAMDA/TestClasses/StringTkoenizer.txt");
//	  ListClasses.add("c:/MAMDA/MAMDA/TestClasses/Fraction.txt");
//	  ListClasses.add("C:/MAMDA/NanoXML/CUT.txt");
	  return ListClasses;
  }
  public static List<Integer> getclass_maximum_branch(){
	  List<Integer> ListClasses=new LinkedList<Integer>();

//	  ListClasses.add(58);//"C:/MAMDA/MAMDA/roops/CUT.txt");	  
	  ListClasses.add(560);//(806);//("c:/MAMDA/jdom.git/CUT.txt");
	//  ListClasses.add("C:/MAMDA/JodaTime/CUT.txt");
//	  ListClasses.add(72);//"c:/MAMDA/MAMDA/TestClasses/StringTkoenizer.txt");
//	  ListClasses.add(140);//"c:/MAMDA/MAMDA/TestClasses/Fraction.txt");
//	  ListClasses.add(136);//"C:/MAMDA/NanoXML/CUT.txt");
	  return ListClasses;
  }
 
}